import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
const router = new Router({
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '*',
      component: () => import('../views/notFound.vue')
    },
    /* 大屏 */
    {
      path: '/dashboard',
      name: 'dashboard',
      component: () => import('../views/dashboard')
    },
    /* 首页 */
    {
      path: '/index',
      name: 'index',
      component: () => import('../views/index.vue'),
      meta: {
        moduleName: 'index',
        keepAlive: false
      }
    },
    {
      path: '/village',
      name: 'villageIndex',
      component: () => import('../views/village/index.vue'),
      meta: {
        moduleName: 'index',
        keepAlive: false
      },
      children: [
        {
          path: 'index/:deptId',
          component: () => import('../views/village/template/index.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        {
          path: 'tempA',
          component: () => import('../views/village/template/templateA.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        {
          path: 'hhdb/:deptId',
          component: () => import('../views/village/template/hhdb/index.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        {
          path: 'bzc/:deptId',
          component: () => import('../views/village/template/bzc/index.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        {
          path: 'mqc/:deptId',
          component: () => import('../views/village/template/mqc/index.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        {
          path: 'scds/:deptId',
          component: () => import('../views/village/template/scds/index.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        {
          path: 'xyl/:deptId',
          component: () => import('../views/village/template/xyl/index.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        {
          path: 'pty/:deptId',
          component: () => import('../views/village/template/pty/index.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        {
          path: 'rzxy/:deptId',
          component: () => import('../views/village/template/rzxy/index.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        {
          path: 'aqlt/:deptId',
          component: () => import('../views/village/template/aqlt/index.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        {
          path: 'aqltb/:deptId',
          component: () => import('../views/village/template/aqlt/indexb.vue'),
          meta: {
            moduleName: 'index'
          }
        },
        /* 短信模板 */
        {
          path: 'msgset/:deptId',
          component: () =>
            import('../views/village/template/aqlt/msgSetting.vue'),
          meta: {
            moduleName: 'index'
          }
        }
      ]
    },
    {
      path: '/event',
      redirect: '/event/supervise'
    },
    /* 督办工作 */
    {
      path: '/event/supervise',
      name: 'eventSupervise',
      component: () => import('../views/event/supervise.vue'),
      meta: {
        moduleName: 'eventSupervise',
        keepAlive: false
      }
    },
    /* 事件查询 */
    {
      path: '/event/search',
      name: 'eventSearch',
      component: () => import('../views/event/search.vue'),
      meta: {
        moduleName: 'eventSearch',
        keepAlive: true
      }
    },
    /* 事件查询--详情 */
    {
      path: '/event/search/detail',
      name: 'eventSearchDetail',
      component: () => import('../views/event/searchDetail.vue'),
      meta: {
        moduleName: 'eventSearch',
        keepAlive: false
      }
    },
    /* 事件上传 */
    {
      path: '/event/upload',
      name: 'eventUpload',
      component: () => import('../views/event/upload.vue'),
      meta: {
        moduleName: 'eventUpload',
        keepAlive: false
      }
    },
    /* 人员列表 */
    {
      name: 'userList',
      path: '/user/search',
      component: () => import('../views/user/userList.vue'),
      meta: {
        moduleName: 'userList',
        keepAlive: false
      }
    },
    /* 人员详情 */
    {
      name: 'userDetail',
      path: '/user/detail/:userId',
      component: () => import('../views/user/userDetail.vue'),
      meta: {
        moduleName: 'userList',
        keepAlive: false
      }
    },
    {
      name: 'userModify',
      path: '/user/modify/:userId',
      component: () => import('../views/user/userModify.vue'),
      meta: {
        moduleName: 'userList',
        keepAlive: false
      }
    },
    /* 部门列表 */
    {
      name: 'departmentList',
      path: '/department/list',
      component: () => import('../views/department/list.vue'),
      meta: {
        moduleName: 'departmentList',
        keepAlive: false
      }
    },
    {
      name: 'departmentChild',
      path: '/department/list/:deptId',
      component: () => import('../views/department/child.vue'),
      meta: {
        moduleName: 'departmentList',
        keepAlive: false
      }
    },
    /* 短信配置 */
    {
      name: 'sysMsg',
      path: '/sysmsg/setting',
      component: () => import('../views/sysmsg/index.vue'),
      meta: {
        moduleName: 'sysMsg',
        keepAlive: false
      }
    },
    /* 系统日志 */
    {
      name: 'systemLog',
      path: '/system/logs',
      component: () => import('../views/log/index.vue'),
      meta: {
        moduleName: 'systemLog',
        keepAlive: false
      }
    },
    /* 设备首页 */
    {
      path: '/device/list',
      name: 'deviceList',
      component: () => import('../views/device/list.vue'),
      meta: {
        moduleName: 'deviceList',
        keepAlive: false
      }
    },
    {
      path: '/device/search',
      name: 'deviceSearch',
      component: () => import('../views/device/search.vue'),
      meta: {
        moduleName: 'deviceSearch',
        keepAlive: false
      }
    },
    /* 设备编辑/新增 */
    {
      path: '/device/edit',
      name: 'deviceEdit',
      component: () => import('../views/device/edit.vue'),
      meta: {
        moduleName: 'deviceSearch',
        keepAlive: false
      }
    },
    {
      path: '/device/view',
      name: 'deviceView',
      component: () => import('../views/device/view.vue'),
      meta: {
        moduleName: 'deviceSearch',
        keepAlive: false
      }
    },
    /* 报表统计 */
    {
      path: '/report',
      redirect: '/report/search'
    },
    {
      path: '/report/search',
      name: 'reportSearch',
      component: () => import('../views/report/reportSearch.vue'),
      meta: {
        moduleName: 'reportSearch',
        keepAlive: false
      }
    },
    /* 场景管理 */
    {
      path: '/type/list',
      name: 'typeList',
      component: () => import('../views/applicationType/typeList.vue'),
      meta: {
        moduleName: 'typeList',
        keepAlive: false
      }
    },
    /* 菜单管理 */
    {
      path: '/role/list',
      name: 'menuList',
      component: () => import('../views/role/list.vue'),
      meta: {
        moduleName: 'menuList',
        keepAlive: false
      }
    },
    /* 智能门禁-人员进出列表 */
    {
      path: '/entrance-guard-list/:id',
      name: 'entranceGuardList',
      component: () =>
        import('../views/village/template/rzxy/entranceGuardList'),
      meta: {
        moduleName: 'index',
        keepAlive: false
      }
    },
    // 社区事项
    {
      path: '/community',
      name: 'community',
      component: () => import('../views/miniprogram/community.vue'),
      meta: {
        moduleName: 'community',
        keepAlive: false
      }
    },
    {
      path: '/community/baoshiDetail/:id',
      name: 'baoshiDetail',
      component: () => import('../views/miniprogram/baoshiDetail.vue'),
      meta: {
        moduleName: 'community',
        keepAlive: false
      }
    },
    {
      path: '/community/tousuDetail/:id',
      name: 'tousuDetail',
      component: () => import('../views/miniprogram/tousuDetail.vue'),
      meta: {
        moduleName: 'community',
        keepAlive: false
      }
    },
    // 线上发布
    {
      path: '/announce',
      name: 'announce',
      component: () => import('../views/miniprogram/announce.vue'),
      meta: {
        moduleName: 'announce',
        keepAlive: false
      }
    },
    {
      path: '/announce/noticeDetail/:id',
      name: 'noticeDetail',
      component: () => import('../views/miniprogram/noticeDetail.vue'),
      meta: {
        moduleName: 'announce',
        keepAlive: false
      }
    },
    {
      path: '/announce/activityDetail/:id',
      name: 'activityDetail',
      component: () => import('../views/miniprogram/activityDetail.vue'),
      meta: {
        moduleName: 'announce',
        keepAlive: false
      }
    },
    // 人员信息
    {
      path: '/applet/user',
      name: 'appletUser',
      component: () => import('../views/miniprogram/userInfo.vue'),
      meta: {
        moduleName: 'appletUser',
        keepAlive: false
      }
    },
    /* 人员详情 */
    {
      name: 'appletUserDetail',
      path: '/applet/user/:userId',
      component: () => import('../views/miniprogram/userDetail.vue'),
      meta: {
        moduleName: 'appletUser',
        keepAlive: false
      }
    },
    // 管理员
    {
      path: '/applet/manager',
      name: 'appletManager',
      component: () => import('../views/miniprogram/manager.vue'),
      meta: {
        moduleName: 'appletManager',
        keepAlive: false
      }
    },
    {
      name: 'userManager',
      path: '/manager/addModify/:userId',
      component: () => import('../views/miniprogram/addModify.vue'),
      meta: {
        moduleName: 'appletManager',
        keepAlive: false
      }
    },
    // 小程序菜单
    {
      name: 'appletMenu',
      path: '/applet/menu',
      component: () => import('../views/miniprogram/menu.vue'),
      meta: {
        moduleName: 'appletMenu',
        keepAlive: false
      }
    },
    /* 居民管理 */
    {
      path: '/resident',
      name: 'resident',
      component: () => import('../views/resident'),
      meta: {
        moduleName: 'resident',
        keepAlive: false
      }
    },
    /* 居民详情 */
    {
      name: 'residentDetail',
      path: '/resident/:userId',
      component: () => import('../views/resident/detail.vue'),
      meta: {
        moduleName: 'resident',
        keepAlive: false
      }
    },
    /* 房屋管理 */
    {
      path: '/house',
      name: 'house',
      component: () => import('../views/house'),
      meta: {
        moduleName: 'house',
        keepAlive: false
      }
    },
    {
      path: '/housedetail/:id',
      name: 'addModifyHouse',
      component: () => import('../views/house/addModifyHouse.vue'),
      meta: {
        moduleName: 'house',
        keepAlive: false
      }
    },
    /* 楼栋管理 */
    {
      path: '/houseside',
      name: 'houseside',
      component: () => import('../views/house/building.vue'),
      meta: {
        moduleName: 'houseside',
        keepAlive: false
      }
    },
    {
      path: '/houseside/:id',
      name: 'addModifyBuilding',
      component: () => import('../views/house/addModifyBuilding.vue'),
      meta: {
        moduleName: 'houseside',
        keepAlive: false
      }
    },
    {
      path: '/car/list',
      name: 'carList',
      component: () => import('../views/car/list.vue'),
      meta: {
        moduleName: 'carList',
        keepAlive: false
      }
    },
    {
      path: '/car/traffic',
      name: 'traffic',
      component: () => import('../views/car/traffic.vue'),
      meta: {
        moduleName: 'traffic',
        keepAlive: false
      }
    },
    // 门禁管理
    {
      path: '/door',
      name: 'door',
      component: () => import('../views/door'),
      meta: {
        moduleName: 'door',
        keepAlive: false
      }
    },
    // 访客管理
    {
      path: '/visitor',
      name: 'visitor',
      component: () => import('../views/visitor'),
      meta: {
        moduleName: 'visitor',
        keepAlive: false
      }
    },
    // 巡更管理
    {
      path: '/xgdw',
      name: 'visitor',
      component: () => import('../views/patrol'),
      meta: {
        moduleName: 'xgdw',
        keepAlive: false
      }
    },
    {
      path: '/xgjl',
      name: 'visitor',
      component: () => import('../views/patrol/log.vue'),
      meta: {
        moduleName: 'xgjl',
        keepAlive: false
      }
    }
  ]
})
export default router
